/*
 * This file (RxPixels.java) is protected by the GNU GPL licence (v2). 
 * Please read the license.txt attached for further informations. 
 * 
 */

package alkwarel.shapes;

import alkwarel.objects.AkArtspace;
import alkwarel.objects.RxShape;
import artx.utils.AxLog;
import artx.utils.AxRandom;

/**
 * @author Xavier Gouchet
 * 
 */
public class RxPixels extends RxShape {

	/**
	 * Standard constructor.
	 */
	public RxPixels() {
		super(4, "pixels");
	}

	/**
	 * @see alkwarel.objects.RxShape#Draw(alkwarel.objects.AkArtspace)
	 */
	protected boolean Draw(AkArtspace a) {
		AxLog.Debug("RxPixels::Draw =>> drawing pixels");
		for (int i = 0; i < a.width; i++) {
			for (int j = 0; j < a.height; j++) {
				// draws on 5% of all pixels
				if (AxRandom.RandB(5)) {
					a.point(i, j);
				}
			}
		}
		return true;
	}

}
